package de.dlrg.wms.controller.controllers.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import de.dlrg.wms.controller.controllers.DisciplineController;
import de.dlrg.wms.model.Discipline;
import static de.dlrg.wms.model.Discipline.Discipline;

public class DisciplineAdder {
	@Autowired
	private DisciplineController disciplineController;
	
	private void createOrUpdate(Discipline toCreateOrUpdate) {
		this.disciplineController.createOrUpdate(toCreateOrUpdate);
	}
	
	public void execute() {
		createOrUpdate(Discipline().setDescription("25m Brust").setName("25m Brust"));
		createOrUpdate(Discipline().setDescription("50m Brust").setName("50m Brust"));
		createOrUpdate(Discipline().setDescription("25m Ruecken").setName("25m Ruecken"));
		createOrUpdate(Discipline().setDescription("50m Ruecken").setName("50m Ruecken"));
		createOrUpdate(Discipline().setDescription("100m Freistil").setName("100m Freistil"));
		createOrUpdate(Discipline().setDescription("100m Retten").setName("100m Retten"));
	}
}
